Intersoft WebTextEditor Documentation
Auto Save
See Also Send Feedback
Intersoft WebTextEditor > WebTextEditor > Editing Architecture > Auto Save

Glossary Item Box

WebTextEditor introduces innovative feature which performs auto saving based on configurable interval.  Auto save operation will be invoked through AJAX callback and will be performed only when the document is modified. Developers can write their own codes to handle the auto saving operation in Save server-side event. For instances, the content can be saved to a file, database, or other storage.

Here are the steps to implement auto save in WebTextEditor:

  1. Set EnableAutoSave property to true.
  2. Set AutoSaveInterval property, default is 15 minutes.
  3. Handle OnSave server side event.
  4. Implement save mechanism in OnSave server side event.

    C# Copy ImageCopy Code
    protected void WebTextEditor1_Save(object sender, WebTextEditorSaveArgs e)
    {      
       if (e.SaveAction == SaveAction.AutoSave)      
       {             
          StreamWriter sw = new StreamWriter(HttpContext.Current.Server.MapPath("./SampleHtml/AutoSave.html"));
          sw.Write(e.Content);             
          sw.Flush();             
          sw.Close();      
       }
    }
    

The above sample will perform auto save every 15 minute and the content will be saved to file "AutoSave.html".

See Also

©2013. All Rights Reserved.